﻿<Window x:Class="eJack.Mortgage.Tool.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Mortgage Calculators v1.0 - JACK D." Height="660" Width="605"
		Foreground="BlueViolet"
		ResizeMode="NoResize">
	<StackPanel Margin="3 5">
		<Border BorderThickness="0.6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderBrush="Purple"></Border>

		<StackPanel HorizontalAlignment="Right" Margin="0 6 15 0" Orientation="Horizontal">
			<RadioButton x:Name="lang_en" GroupName="language" Content="English" Margin="0 0 5 0" FontWeight="SemiBold" IsChecked="True" Checked="onRadioButton_Checked"/>
			<RadioButton x:Name="lang_cn" GroupName="language" Content="Chinese" FontWeight="SemiBold" Checked="onRadioButton_Checked"/>
		</StackPanel>

		<!--Monthly Payment Calculator-->
		<GroupBox Margin="12 0 12 5">
			<!--<GroupBox.ToolTip>
				<Label x:Name="mpc_tip" FontSize="11.5" Margin="0 -4 0 0" FontStyle="Italic" Foreground="Red">This tool will calculate your monthly payment based on the loan amount, interest rate, and term that you provide.</Label>
			</GroupBox.ToolTip>-->
			<GroupBox.Header>
				<TextBlock x:Name="mpc_header" FontWeight="SemiBold">Monthly Payment Calculator</TextBlock>
			</GroupBox.Header>

			<Grid Margin="5 10 5 0" >
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="20" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="20" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>

				<StackPanel Orientation="Vertical" Grid.RowSpan="3" Margin="5 0 0 0">
					<Label x:Name="mpc_loan" Content="Loan Amount: " FontWeight="Medium" VerticalContentAlignment="Center" />
					<StackPanel Orientation="Horizontal">
						<Label Content="$" Margin="3 0 0 0"></Label>
						<TextBox x:Name="txtMPC_LoanAmount" Width="180" Height="25" Background="LightCyan" FontWeight="SemiBold" VerticalContentAlignment="Center" 
							 Text="100,000" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
					</StackPanel>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Column="2">
					<Label x:Name="mpc_interest" Content="Rate: " FontWeight="Medium" Width="55"/>
					<TextBox x:Name="txtMPC_Interest" Width="130" Height="25" VerticalContentAlignment="Center" 
							 Background="LightCyan" FontWeight="SemiBold" Text="3.5" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onInterest_LostFocus"></TextBox>
					<Label Content="%" VerticalAlignment="Bottom" Margin="0 0 0 -3"></Label>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Margin="0 0 0 5" Grid.Column="2" Grid.Row="2">
					<Label x:Name="mpc_term_year" Content="Term: " FontWeight="Medium" Width="55"/>
					<TextBox x:Name="txtMPC_TermYears" Width="130" Height="25" VerticalContentAlignment="Center" 
							 Background="LightCyan" FontWeight="SemiBold" Text="30" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onTermYears_LostFocus"></TextBox>
					<Label x:Name="mpc_year_suffix" Content="years" VerticalAlignment="Bottom" Margin="0 0 0 -3"></Label>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Column="3" Grid.RowSpan="3" HorizontalAlignment="Right" Margin="18 0 0 0">
					<Button x:Name="btnMPC" Height="26" Width="60" Click="btnMPC_Click">Calculate</Button>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Bottom">
					<Label Content="=" Foreground="#ED1C24" VerticalAlignment="Top" FontSize="11" Margin="0 -5 0 0"></Label>
					<TextBlock x:Name="txtMPC_Result" Foreground="#ED1C24" FontStyle="Italic" FontSize="12" VerticalAlignment="Center" 
							   Margin="1 0 3 3" FontWeight="SemiBold">$00.00</TextBlock>
				</StackPanel>

				<TextBlock x:Name="mpc_schedule" Grid.Row="5" Grid.ColumnSpan="3" FontSize="11" Text="Payment Schedule:" Foreground="DarkGoldenrod" FontWeight="SemiBold" FontStyle="Italic" Margin="6 0 0 0"></TextBlock>

				<StackPanel Orientation="Horizontal" Margin="5 0 0 5" Grid.ColumnSpan="3" Grid.Row="7">
					<Label x:Name="mpc_schedule_extra" Content="Extra Monthly Payment: " FontWeight="Medium" Width="145"/>
					<TextBox x:Name="txtMPC_ExtraPayment" Width="130" Height="25" VerticalContentAlignment="Center" 
							 Background="LightCyan" FontWeight="SemiBold" Text="0" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Margin="5 0 0 5" Grid.ColumnSpan="3" Grid.Row="9">
					<Label x:Name="mpc_schedule_loan_start" Content="Loan Sart Date: " FontWeight="Medium" Width="145"/>
					<DatePicker x:Name="dpMPC_DateLoan" Width="130" Text="2017-01-01"></DatePicker>
					<!--<TextBox x:Name="txtMPC_DateLoan" Width="130" Height="25" VerticalContentAlignment="Center" 
							 Background="LightCyan" FontWeight="SemiBold" Text="0" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>-->
				</StackPanel>

				<StackPanel Orientation="Horizontal"  Grid.ColumnSpan="3" Grid.Row="9" HorizontalAlignment="Right" Margin="0 -4 -80 0">
					<Button x:Name="btnMPC_Schedule" Height="26" Width="120" Click="btnMPC_Schedule_Click" >Payment Schedule</Button>
				</StackPanel>

			</Grid>

		</GroupBox>

		<!--What Can I Afford Calculator-->
		<GroupBox Margin="12 5 12 5">
			<!--<GroupBox.ToolTip>
				<StackPanel Orientation="Vertical">
					<Label FontSize="11.5" Margin="0 -4 0 0" FontStyle="Italic" Foreground="Red">By entering in your desired monthly payment, interest rate, and term, we can calculate the maximum loan amount you can afford.</Label>
					<Label FontSize="11.5" Margin="0 -4 0 0" FontStyle="Italic" Foreground="Red">This calculation does not include any other fees that might be included with your mortgage payments.</Label>
				</StackPanel>
			</GroupBox.ToolTip>-->
			<GroupBox.Header>
				<TextBlock x:Name="wcia_header" FontWeight="SemiBold">What Can I Afford Calculator</TextBlock>
			</GroupBox.Header>

			<Grid Margin="5 10 5 0" >
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="20" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="20" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>

				<StackPanel Orientation="Vertical" Grid.RowSpan="3" Margin="5 0 0 0">
					<Label x:Name="wcia_desired_month_payment" Content="Desired Monthly Payment: " FontWeight="Medium" VerticalContentAlignment="Center" />
					<StackPanel Orientation="Horizontal">
						<Label Content="$" Margin="3 0 0 0"></Label>
						<TextBox x:Name="txtWCIA_DesireMonthPayment" Width="180" Height="25" Background="LightCyan" FontWeight="SemiBold" VerticalContentAlignment="Center" 
							 Text="1,000" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
					</StackPanel>

				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Column="2">
					<Label x:Name="wcia_rate" Content="Rate: " FontWeight="Medium" Width="55"/>
					<TextBox x:Name="txtWCIA_Interest" Width="130" Height="25" VerticalContentAlignment="Center" 
							 Background="LightCyan" FontWeight="SemiBold" Text="3.5" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onInterest_LostFocus"></TextBox>
					<Label Content="%" VerticalAlignment="Bottom" Margin="0 0 0 -3"></Label>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Margin="0 0 0 5" Grid.Column="2" Grid.Row="2">
					<Label x:Name="wcia_term_year" Content="Term: " FontWeight="Medium" Width="55"/>
					<TextBox x:Name="txtWCIA_TermYears" Width="130" Height="25" VerticalContentAlignment="Center" 
							 Background="LightCyan" FontWeight="SemiBold" Text="30" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onTermYears_LostFocus"></TextBox>
					<Label x:Name="wcia_year_suffix" Content="years" VerticalAlignment="Bottom" Margin="0 0 0 -3"></Label>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Column="3" Grid.RowSpan="3" HorizontalAlignment="Right" Margin="18 0 0 0">
					<Button x:Name="btnWCIA" Height="26" Width="60" Click="btnWCIA_Click">Calculate</Button>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Bottom">
					<Label Content="=" Foreground="#ED1C24" VerticalAlignment="Top" FontSize="11" Margin="0 -5 0 0"></Label>
					<TextBlock x:Name="txtWCIA_Result" Foreground="#ED1C24" FontStyle="Italic" FontSize="12" VerticalAlignment="Center" 
							   Margin="1 0 3 3" FontWeight="SemiBold">$00.00</TextBlock>
				</StackPanel>

			</Grid>
		</GroupBox>

		<!--How Much Can I Borrow Calculator-->
		<GroupBox Margin="12 5 12 5">
			<!--<GroupBox.ToolTip>
				<StackPanel Orientation="Vertical">
					<Label FontSize="11.5" Margin="0 -4 0 0" FontStyle="Italic" Foreground="Red">To get a sense of how much you may be able to borrow, fill in the form below and click on the calculate button.</Label>
					<Label FontSize="11.5" Margin="0 -4 0 0" FontStyle="Italic" Foreground="Red">Please note that prequalification is different from a pre-approval. Prequalification gives you an estimate of how much you may be able to borrow.</Label>
					<Label FontSize="11.5" Margin="0 -4 0 0" FontStyle="Italic" Foreground="Red">Pre-approval, on the other hand, indicates that you have been approved for a set loan amount prior to property selection.</Label>
				</StackPanel>
			</GroupBox.ToolTip>-->
			<GroupBox.Header>
				<TextBlock x:Name="hmyb_header" FontWeight="SemiBold">How Much Can I Borrow Calculator</TextBlock>
			</GroupBox.Header>

			<Grid Margin="5 10 5 0" >
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="6" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="6" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="3" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="10" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="20" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="15" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>

				<!--row: 1-->
				<StackPanel Orientation="Horizontal">
					<Label x:Name="hmyb_salary" Content="Annual Salary:" FontWeight="Medium" Width="88"/>
					<Label Content="$"></Label>
					<TextBox x:Name="txtHMYB_AnnualSalary" Width="130" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="50,000" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Column="2">
					<StackPanel.ToolTip>
						<Label x:Name="hmyb_debt_month_detail" Grid.Row="1" FontSize="11.5" Margin="0 -4 0 0" FontStyle="Italic" Foreground="Red">(Include only loans that won't be paid off in 10 months.)</Label>
					</StackPanel.ToolTip>
					<Label x:Name="hmyb_debt_month" Content="Monthly Debt: " FontWeight="Medium" Width="88"/>
					<Label Content="$"></Label>
					<TextBox x:Name="txtHMYB_MonthlyDebt" Width="130" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="0" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
				</StackPanel>

				<!--row: 2-->
				<TextBlock x:Name="hmyb_loan_term_desire" Grid.Row="2" Grid.ColumnSpan="3" FontSize="11" Text="Loan Terms You Desire:" Foreground="DarkGoldenrod" FontWeight="SemiBold" FontStyle="Italic" Margin="6 0 0 0"></TextBlock>

				<StackPanel Orientation="Horizontal" Grid.Row="4">
					<Label x:Name="hmyb_price" Content="Purchase Price: " FontWeight="Medium" Width="88"/>
					<Label Content="$"></Label>
					<TextBox x:Name="txtHMYB_PurchasePrice" Width="130" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="250,000" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="2">
					<Label x:Name="hmyb_rate" Content="Rate: " FontWeight="Medium" Width="103"/>
					<TextBox x:Name="txtHMYB_Interest" Width="130" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="3.5" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onInterest_LostFocus"></TextBox>
					<Label Content="%" Margin="0 0 0 -5"></Label>
				</StackPanel>

				<!--row: 4-->
				<StackPanel Orientation="Horizontal" Grid.Row="6">
					<Label x:Name="hmyb_down_payment" Content="Down Pay: " FontWeight="Medium" Width="88"/>
					<Label Content="$"></Label>
					<TextBox x:Name="txtHMYB_DownPayment_Amount" Width="75" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="0" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
					<Label Content="or"></Label>
					<TextBox x:Name="txtHMYB_DownPayment_Percent" Width="35" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="0" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
					<Label Content="%" Margin="0 0 0 -5"></Label>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="2">
					<Label x:Name="hmyb_term_year" Content="Term: " FontWeight="Medium" Width="103"/>
					<TextBox x:Name="txtHMYB_TermYears" Width="130" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="30" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onTermYears_LostFocus"></TextBox>
					<Label x:Name="hmyb_year_suffix" Content="years" Margin="0 0 0 -5"></Label>
				</StackPanel>

				<!--row: 8-->
				<TextBlock x:Name="hmyb_property_tax_insurance" Grid.Row="8" Grid.ColumnSpan="3" FontSize="11" Text="Property - Expected Taxes / Insurance (yearly):" Foreground="DarkGoldenrod" FontWeight="SemiBold" FontStyle="Italic" Margin="6 0 0 0"></TextBlock>

				<!--row: 10-->
				<StackPanel Orientation="Horizontal" Grid.Row="10">
					<Label x:Name="hmyb_tax" Content="Tax: " FontWeight="Medium" Width="88"></Label>
					<Label Content="$"></Label>
					<TextBox x:Name="txtHMYB_YearlyTax" Width="130" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="0" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Row="10" Grid.Column="2">
					<Label x:Name="hmyb_insurance" Content="Insurance: " FontWeight="Medium" Width="88"></Label>
					<Label Content="$"></Label>
					<TextBox x:Name="txtHMYB_YearlyInsurance" Width="130" Height="25" VerticalContentAlignment="Center" Margin="-2 0 0 0"
							 Background="LightCyan" FontWeight="SemiBold" Text="0" FontFamily="Segoe UI Semilight" FontSize="14" LostFocus="onMoney_LostFocus"></TextBox>
				</StackPanel>

				<!--row: 12-->
				<StackPanel Orientation="Horizontal" Grid.Row="12" Grid.Column="3" HorizontalAlignment="Right" Margin="0 0 36 0">
					<Button x:Name="btnHMYB" Height="26" Width="60" Click="btnHMYB_Click" >Calculate</Button>
				</StackPanel>

				<StackPanel Orientation="Horizontal" Grid.Row="12" Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 110 0">
					<Label Content="=" Foreground="#ED1C24" VerticalAlignment="Top" FontSize="11" Margin="0 -2 0 0"></Label>
					<TextBlock x:Name="txtHMYB_Result" Foreground="#ED1C24" FontStyle="Italic" FontSize="12" VerticalAlignment="Center" 
							   Margin="1 0 3 3" FontWeight="SemiBold">$00.00</TextBlock>
				</StackPanel>

			</Grid>

		</GroupBox>


	</StackPanel>
</Window>
